<?php
//=======================================
//###################################
// Kayako Web Solutions
//
// Source Copyright 2001-2004 Kayako Web Solutions
// Unauthorized reproduction is not allowed
// License Number: $%LICENSE%$
// $Author: vshoor $ ($Date: 2006/05/18 22:20:30 $)
// $RCSfile: impex.news.php,v $ : $Revision: 1.1 $ 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###################################
//=======================================

if (!defined("INSWIFT")) {
	trigger_error("Unable to process $PHP_SELF", E_USER_ERROR);
}

/**
* Return the Total Pages for this Plugin
*/
function getPluginTotalPages8()
{
	return 1;
}

/**
* Run the specific page for plugin
*/
function runPluginPage8($page)
{
	global $dbCore, $_IMPEXHASH, $impexDB;

	// Insert News
	if ($page == 1)
	{
		$newslist = array();
		$impexDB->query("SELECT * FROM `announcements` ORDER BY `id` ASC;");
		while ($impexDB->nextRecord())
		{
			_impexProcessSlashVariables($impexDB->Record);

			$newslist[$impexDB->Record["id"]] = $impexDB->Record;
		}

		foreach ($newslist as $key=>$val)
		{
			_impexInsertNews($val["title"], "", $val["details"], time(), 0);
	
			displayStatus("Imported News: ".htmlspecialchars($val["title"]));
		}
	}
}
?>